package com.jingxing.controller;

import com.jingxing.config.ApiResult;
import com.jingxing.pojo.ReceivingRecord;
import com.jingxing.service.ReceivingRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/receivingRecord")
@Api(value = "API", tags = {"领取记录相关"})
public class ReceivingRecordController {
    @Autowired
    private ReceivingRecordService receivingRecordService;

    @PostMapping("/getRewardReceives")
    @ApiOperation("获取奖品领取信息")
    public ApiResult getRewardReceives(String playerName, String prizeName) {
        List<ReceivingRecord> receivingRecords = receivingRecordService.getReceivingRecords(playerName, prizeName);
        return ApiResult.ok(receivingRecords);
    }


}
